package com.ruoyi.project.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.ProjectEnvironmentMapper;
import com.ruoyi.project.domain.ProjectEnvironment;
import com.ruoyi.project.service.IProjectEnvironmentService;

/**
 * 功能模块Service业务层处理
 * 
 * @author yhg
 * @date 2022-10-18
 */
@Service
public class ProjectEnvironmentServiceImpl implements IProjectEnvironmentService 
{
    @Autowired
    private ProjectEnvironmentMapper projectEnvironmentMapper;

    /**
     * 查询功能模块
     * 
     * @param id 功能模块主键
     * @return 功能模块
     */
    @Override
    public ProjectEnvironment selectProjectEnvironmentById(Long id)
    {
        return projectEnvironmentMapper.selectProjectEnvironmentById(id);
    }

    /**
     * 查询功能模块列表
     * 
     * @param projectEnvironment 功能模块
     * @return 功能模块
     */
    @Override
    public List<ProjectEnvironment> selectProjectEnvironmentList(ProjectEnvironment projectEnvironment)
    {
        return projectEnvironmentMapper.selectProjectEnvironmentList(projectEnvironment);
    }

    /**
     * 新增功能模块
     * 
     * @param projectEnvironment 功能模块
     * @return 结果
     */
    @Override
    public int insertProjectEnvironment(ProjectEnvironment projectEnvironment)
    {
        projectEnvironment.setCreateTime(DateUtils.getNowDate());
        return projectEnvironmentMapper.insertProjectEnvironment(projectEnvironment);
    }

    /**
     * 修改功能模块
     * 
     * @param projectEnvironment 功能模块
     * @return 结果
     */
    @Override
    public int updateProjectEnvironment(ProjectEnvironment projectEnvironment)
    {
        projectEnvironment.setUpdateTime(DateUtils.getNowDate());
        return projectEnvironmentMapper.updateProjectEnvironment(projectEnvironment);
    }

    /**
     * 批量删除功能模块
     * 
     * @param ids 需要删除的功能模块主键
     * @return 结果
     */
    @Override
    public int deleteProjectEnvironmentByIds(Long[] ids)
    {
        return projectEnvironmentMapper.deleteProjectEnvironmentByIds(ids);
    }

    /**
     * 删除功能模块信息
     * 
     * @param id 功能模块主键
     * @return 结果
     */
    @Override
    public int deleteProjectEnvironmentById(Long id)
    {
        return projectEnvironmentMapper.deleteProjectEnvironmentById(id);
    }
}
